//var arr = [90, 80, 70, 60, 75];
//console.log(arr);
//console.log(arr[0]);
//
//
//
//
//var num = 0;
//for (i=0;i<arr.length;i++){
//    num +=arr[i];
//}
//console.log(num);

//var sss = num / arr.length;
//console.log(sss);
//var arr_n = ["小明",12,"男",50];
//console.log("我叫"+arr_n[0]+",是个"+arr_n[2]+"孩子,今年"+arr_n[1]+",体重"+arr_n[3]+"公斤");

//var a = new Array(1,2,3,4,5);
//var b = [1,2,3,4,5];
//console.log(b);
//b[1] = 50;
//b[2] = 60;
//
//b[3] = b[1]+b[2];
//console.log(b[3]);
//
//
//console.log(b.length);
//
//
//b[4] = 70;
//b[5]=80;
//b[b.length]=80;
//b[b.length]=999;
//console.log(b);

//var arr=[8,4,2,1,23,344,12];
//var num = 0;
//for (i=0;i<arr.length;i++){
//    num+=arr[i];
//}
//console.log(arr);
//console.log(num);
//var sss = num/arr.length;
//console.log(sss);

//var box = ["小明",12,"前端"];
//box.push("沧州");
//box.push("运河区");
//box.pop();
//box.pop();
//console.log(box);
//var box1 = ["小红",13,"后台"];
//var box3 = box.concat(box1);
//console.log(box3);
//console.log(box.join("/"));


//var ccc = [5,4,3,6,2,10,11];
//function sortNumber(a, b)
//{
//    return a - b
//}
//console.log(ccc.sort(sortNumber));
//
//








var arr=[2,7,1,8,6,4,3,5,9];

function mintomax(par){

    var length=par.length;

    for(var i=0; i<length-1; i++){

        for(var j=0; j<length-i-1; j++){

            if(par[j]>par[j+1]){

                var temp=par[j+1];

                par[j+1]=par[j];

                par[j]=temp;

            }

        }

    }

    return par;

}

console.log(mintomax(arr));








//
//var arr = [ 2,7,1,8,6,4,3,5,9];
////console.log(arr[0]);
////console.log(arr[1]);
////console.log(arr[2]);
////console.log(arr[3]);
////console.log(arr[4]);
////console.log(arr[5]);
////console.log(arr[6]);
////console.log(arr[7]);
////console.log(arr[8]);
//for (var i=0;i<arr.length-1;i++) {
//    if (arr[i]<arr[i+1]){      //升序  最大的排在前面
//        var tame=arr[i];
//        arr[i]=arr[i+1];
//        arr[i+1]=tame
//    }
//}
//console.log(arr);

//for (var j=0;j<arr.length-1;j++){
//    if (arr[j]>arr[j+1]){      //降续  最小的的排在前面
//    var tame=arr[j];
//    arr[j]=arr[j+1];
//    arr[j+1]=tame
//     }
//}
//console.log(arr);



//for (var i=0;i<arr.length-1;i++) {
//    if (arr[i]<arr[i-1]){      //升序  最小的排在前面
//        var tame=arr[i];
//        arr[i]=arr[i-1];
//        arr[i-1]=tame
//    }
//}
//console.log(arr);








